import 'package:flutter/cupertino.dart';
import '../services/ad_service.dart';
import '../services/in_app_purchase_service.dart';

// 配置基础类
abstract class AppConfig {
  /// 是否启用内购
  bool get inAppPurchasesEnabled;
  /// 是否启用广告
  bool get adsEnabled;
  ///哪个市场
  String get flavors;
  /// 内购服务
  InAppPurchaseService get paymentService;
  /// 广告服务
  AdService get adService;

  static AppConfig? _instance;

  static AppConfig get current {
    assert(_instance != null, 'AppConfig未初始化');
    return _instance!;
  }

  static void setInstance(AppConfig config) {
    _instance = config;
  }
  Future<void> initialize() async {
    await paymentService.initialize();
    if (adsEnabled) await adService.initialize();
  }

}